from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.action_chains import ActionChains


op = webdriver.ChromeOptions()
op.add_experimental_option('excludeSwitches', ['enable-automation'])
op.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=op)
driver.get("https://jqueryui.com/resources/demos/slider/multiple-vertical.html")
sleep(2)

# moustDrag = driver.switch_to.frame(driver.find_element(By.XPATH,""))
wait = WebDriverWait(driver,5,0.5)
righe = wait.until(EC.presence_of_element_located((By.CSS_SELECTOR,"#master > span")))
left = wait.until(EC.presence_of_element_located((By.CSS_SELECTOR,"#eq > span:nth-child(4) > span")))
chains = ActionChains(driver)
chains.drag_and_drop_by_offset(righe,xoffset=50,yoffset=0).perform()
chains.drag_and_drop_by_offset(left,xoffset=0,yoffset=-30).perform()
driver.quit()
